/**
 * 渐变颜色字体
 */
const beforeMount = (el: HTMLElement, { value }: any) => {
  el.style.backgroundImage = `
    -webkit-gradient(linear,
      0 10,
      0 bottom,
      from(#fefefe),
      to(#41b883))`
  if (value) {
    el.style.backgroundImage = `
    -webkit-gradient(linear,
      0 ${value.top ? value.top : 10},
      0 bottom,
      from(${value.fromColor ? value.fromColor : '#fefefe'}),
      to(${value.toColor ? value.toColor : '#41b883'}))`
  }
  el.style.webkitBackgroundClip = 'text'
  el.style.webkitTextFillColor = 'transparent'
}
export default { beforeMount }